<?php

/**
 * StickyWidget class
 *
 * @author Julot <andy.julot@gmail.com>
 * @since Thursday, June 16, 2011. 02:30 PM
 */
class StickyWidget extends CWidget {

	public function run() {
		$config = array(
			'criteria'=>array(
				'condition'=>'hidden = 0 AND sticky = 1',
				'order'=>'updateTime DESC',
			),
			'pagination'=>false,
		);
		$dataProvider = new CActiveDataProvider('News', $config);
		if ($dataProvider->itemCount) {
			$data = array('dataProvider'=>$dataProvider);
			$this->render('sticky', $data);
		}
	}

}
